package org.dromara.common.translation.core.impl.xhlj;

import lombok.AllArgsConstructor;

import org.dromara.common.core.service.xhlj.XhljActivityAgendaTranslationService;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.annotation.TranslationType;
import org.dromara.common.translation.core.impl.SimpleTranslationImpl;

@AllArgsConstructor
@TranslationType(type = "xhlj_activityAgenda_list")
public class XhljActivityAgendaTranslationListImpl extends SimpleTranslationImpl {


    private final XhljActivityAgendaTranslationService translationService ;

    @Override
    public Object translation(Object key, Translation translation) {
        if(key instanceof Integer id ) {
            if(StringUtils.isEmpty(translation.other())){
                throw  new RuntimeException("翻译：{} other 不能为空" + translation.type());
            }
            return translationService.selectVoListById(id,translation.other());
        }
        return null;
    }
}
